﻿using Engine;
using Game;
namespace Mekiasm
{
    public class SteelChestWidget : BaseEnergyWidget
    {
        public SteelChestWidget(Common.SaveItem toolSaveItem, ComponentMiner componentMiner) : base(componentMiner)
        {
            setTitle("钢箱子");
            int num = 0;
            mekProgress.IsVisible = false;
            GridPanelWidget gridPanel = new GridPanelWidget() { HorizontalAlignment = WidgetAlignment.Center, VerticalAlignment = WidgetAlignment.Center };
            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    InventorySlotWidget slotWidget = new InventorySlotWidget() { Size = new Vector2(48, 48), Margin = new Vector2(4, 2), BevelColor = Color.Gray };
                    slotWidget.AssignInventorySlot(toolSaveItem, num++);
                    gridPanel.Children.Add(slotWidget);
                    gridPanel.SetWidgetCell(slotWidget, new Point2(j, i));
                }
            }
            CanvasMain.Children.Add(gridPanel);
        }
    }
}
